require "Common/define"
require "Logic/Config"
require "Common/functions"

RedDotsCostHandler ={};
local this = RedDotsCostHandler;

function RedDotsCostHandler.init()
    CloseEvent(Config.EventType.Fresh_CostRedDot,this.update);
    ListenEvent(Config.EventType.Fresh_CostRedDot,this.update);

    return this;
end

-- 获取红点状态
function RedDotsCostHandler.getFlag(...)
    if logicMgr.CostManager.getTagRedDotById(...) then
        return Config.RedDotsFlagState.Needful;
    end
    return Config.RedDotsFlagState.None;
end


function RedDotsCostHandler.update()
    RedDotsManager.addBroadcast(Config.RedDotsType.Cost);
end